package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.IntelligentCommunicationService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrbff.common.util.RedisUtil;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrcomponent.integration.FwCompIntelligentCommunicationClient;
import com.wicket.okrcomponent.integration.dto.ImplementIntelligentCommandCommunicationServiceComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementIntelligentCommandCommunicationServiceComReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrapp.integration.FwAppIntelligentCommunicationClient;
import com.wicket.okrapp.integration.dto.ImplementIntelligentCommandCommunicationServicesComRespDto;
import com.wicket.okrapp.integration.dto.ImplementIntelligentCommandCommunicationServicesComReqDto;
import com.wicket.okrapp.integration.dto.ImplementRecordIdeasComRespDto;
import com.wicket.okrapp.integration.dto.ImplementRecordIdeasComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class IntelligentCommunicationServiceImpl
  implements IntelligentCommunicationService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  FwCompIntelligentCommunicationClient fwCompIntelligentCommunicationClient;
@Resource
  FwAppIntelligentCommunicationClient fwAppIntelligentCommunicationClient;
/**
   * B2执行智能指令沟通服务[8124]
   * gen by moon at 12/11/2023, 3:35:27 PM
   */
    @Trace(operationName = "B2执行智能指令沟通服务")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffImplementIntelligentCommandCommunicationServiceRespDto implementIntelligentCommandCommunicationService(BffImplementIntelligentCommandCommunicationServiceReqDto reqDto){
      
       
       ImplementIntelligentCommandCommunicationServicesComRespDto implementIntelligentCommandCommunicationServicesComRespDto_1 =null;
//步骤0: D3执行智能指令沟通服务(公共) - implementIntelligentCommandCommunicationServicesCom
     ImplementIntelligentCommandCommunicationServicesComRespDto implementIntelligentCommandCommunicationServicesComRespDto = null;
    ImplementIntelligentCommandCommunicationServicesComReqDto implementIntelligentCommandCommunicationServicesComReqDto=new ImplementIntelligentCommandCommunicationServicesComReqDto();
  if(reqDto!=null){
      implementIntelligentCommandCommunicationServicesComReqDto.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:1404772_1
implementIntelligentCommandCommunicationServicesComReqDto.setApiKey(reqDto.getApiKey());//SimpleFieldAssign//sourceId:1404773_1
implementIntelligentCommandCommunicationServicesComReqDto.setApiSecret(reqDto.getApiSecret());//SimpleFieldAssign//sourceId:1404774_1
implementIntelligentCommandCommunicationServicesComReqDto.setContent(reqDto.getContent());//SimpleFieldAssign//sourceId:1404775_1
implementIntelligentCommandCommunicationServicesComReqDto.setSn(reqDto.getSn());//SimpleFieldAssign//sourceId:1404776_1
    }
  
    /*D3执行智能指令沟通服务(公共)[8102]   */
    Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getAppId(),"B2执行智能指令沟通服务-D3执行智能指令沟通服务(公共)-应用ID不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getApiKey(),"B2执行智能指令沟通服务-D3执行智能指令沟通服务(公共)-应用key不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getApiSecret(),"B2执行智能指令沟通服务-D3执行智能指令沟通服务(公共)-应用密码不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getContent(),"B2执行智能指令沟通服务-D3执行智能指令沟通服务(公共)-消息内容不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getSn(),"B2执行智能指令沟通服务-D3执行智能指令沟通服务(公共)-设备号不能为空",false);
      implementIntelligentCommandCommunicationServicesComRespDto = fwAppIntelligentCommunicationClient.implementIntelligentCommandCommunicationServicesCom(implementIntelligentCommandCommunicationServicesComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      implementIntelligentCommandCommunicationServicesComRespDto_1 = implementIntelligentCommandCommunicationServicesComRespDto;
    
BffImplementIntelligentCommandCommunicationServiceRespDto retData = new BffImplementIntelligentCommandCommunicationServiceRespDto();
  if(implementIntelligentCommandCommunicationServicesComRespDto_1!=null){
      retData.setContent(implementIntelligentCommandCommunicationServicesComRespDto_1.getContent());//SimpleFieldAssign//sourceId:1404757_1
    }
  

  
  
return retData;
  }
/**
   * B3执行智能沟通服务[8124]
   * gen by moon at 12/12/2023, 7:43:50 PM
   */
    @Trace(operationName = "B3执行智能沟通服务")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffImplementSmartSessionRespDto implementSmartSession(BffImplementSmartSessionReqDto reqDto){


       ImplementIntelligentCommandCommunicationServicesComRespDto implementIntelligentCommandCommunicationServicesComRespDto_1 =null;
//步骤0: D3执行智能指令沟通服务(公共) - implementIntelligentCommandCommunicationServicesCom
     ImplementIntelligentCommandCommunicationServicesComRespDto implementIntelligentCommandCommunicationServicesComRespDto = null;
    ImplementIntelligentCommandCommunicationServicesComReqDto implementIntelligentCommandCommunicationServicesComReqDto=new ImplementIntelligentCommandCommunicationServicesComReqDto();
  if(reqDto!=null){
      implementIntelligentCommandCommunicationServicesComReqDto.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:1404772_1
implementIntelligentCommandCommunicationServicesComReqDto.setApiKey(reqDto.getApiKey());//SimpleFieldAssign//sourceId:1404773_1
implementIntelligentCommandCommunicationServicesComReqDto.setApiSecret(reqDto.getApiSecret());//SimpleFieldAssign//sourceId:1404774_1
implementIntelligentCommandCommunicationServicesComReqDto.setContent(reqDto.getContent());//SimpleFieldAssign//sourceId:1404775_1
implementIntelligentCommandCommunicationServicesComReqDto.setSn(reqDto.getSn());//SimpleFieldAssign//sourceId:1404776_1
    }

    /*D3执行智能指令沟通服务(公共)[8102]   */
    Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getAppId(),"B3执行智能沟通服务-D3执行智能指令沟通服务(公共)-应用ID不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getApiKey(),"B3执行智能沟通服务-D3执行智能指令沟通服务(公共)-应用key不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getApiSecret(),"B3执行智能沟通服务-D3执行智能指令沟通服务(公共)-应用密码不能为空",false);
Assert.isNull(implementIntelligentCommandCommunicationServicesComReqDto.getContent(),"B3执行智能沟通服务-D3执行智能指令沟通服务(公共)-消息内容不能为空",false);
      implementIntelligentCommandCommunicationServicesComRespDto = fwAppIntelligentCommunicationClient.implementIntelligentCommandCommunicationServicesCom(implementIntelligentCommandCommunicationServicesComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


      implementIntelligentCommandCommunicationServicesComRespDto_1 = implementIntelligentCommandCommunicationServicesComRespDto;

BffImplementSmartSessionRespDto retData = new BffImplementSmartSessionRespDto();
  if(implementIntelligentCommandCommunicationServicesComRespDto_1!=null){
      retData.setContent(implementIntelligentCommandCommunicationServicesComRespDto_1.getContent());//SimpleFieldAssign//sourceId:1404757_1
    }




return retData;
  }
/**
   * B3执行记录想法[8317]
   * gen by moon at 1/21/2024, 8:20:03 PM
   */
    @Trace(operationName = "B3执行记录想法")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffImplementRecordIdeasRespDto implementRecordIdeas(BffImplementRecordIdeasReqDto reqDto){


       //步骤0: D3执行记录想法(公共) - implementRecordIdeasCom
     ImplementRecordIdeasComRespDto implementRecordIdeasComRespDto = null;
    ImplementRecordIdeasComReqDto implementRecordIdeasComReqDto=new ImplementRecordIdeasComReqDto();
  implementRecordIdeasComReqDto.setOriginalRoleMemberId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecOriginalRoleMemberId());//CURRENT_ORIGINAL_ROLE_MEMBERID//sourceId:1494114_1
implementRecordIdeasComReqDto.setUserId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecUserId());//CURRENT_USERID//sourceId:1494115_1
implementRecordIdeasComReqDto.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:1494119_1
implementRecordIdeasComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:1494116_1
implementRecordIdeasComReqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID//sourceId:1494117_1
if(reqDto!=null){
      implementRecordIdeasComReqDto.setContent(reqDto.getContent());//SimpleFieldAssign//sourceId:1494118_1
implementRecordIdeasComReqDto.setCustomField(reqDto.getCustomField());//SimpleFieldAssign//sourceId:1494122_1
    }

    /*D3执行记录想法(公共)[8289]   */
    Assert.isNull(implementRecordIdeasComReqDto.getContent(),"B3执行记录想法-D3执行记录想法(公共)-消息内容不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getCustomField(),"B3执行记录想法-D3执行记录想法(公共)-自定义字段不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getOriginalRoleMemberId(),"B3执行记录想法-D3执行记录想法(公共)-身份人员ID不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getUserId(),"B3执行记录想法-D3执行记录想法(公共)-账号ID不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getCreateInductionId(),"B3执行记录想法-D3执行记录想法(公共)-创建人就职记录ID不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getSpaceId(),"B3执行记录想法-D3执行记录想法(公共)-创建于空间ID不能为空",false);
Assert.isNull(implementRecordIdeasComReqDto.getAppId(),"B3执行记录想法-D3执行记录想法(公共)-创建于联盟应用ID不能为空",false);
      implementRecordIdeasComRespDto = fwAppIntelligentCommunicationClient.implementRecordIdeasCom(implementRecordIdeasComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;




BffImplementRecordIdeasRespDto retData = new BffImplementRecordIdeasRespDto();





return retData;
  }
  //
}
